﻿using System;

namespace IconYuan.Model.DTO.Systems
{
    /// <summary>
    /// 商城公共设置
    /// </summary>
    public class SettingDataDto
    {
        public SettingDto setting { get; set; }
    }
    /// <summary>
    /// 商城公共设置详情
    /// </summary>
    public class SettingDto
    {
        /// <summary>
        /// 分类页模板设置
        /// </summary>
        public PageCategoryTemplate page_category_template { get; set; }
        /// <summary>
        /// 积分设置
        /// </summary>
        public PointsNameDto points { get; set; }
        /// <summary>
        /// 充值设置
        /// </summary>
        public RechargeDto recharge { get; set; }
        /// <summary>
        /// 账户注册设置
        /// </summary>
        public RegisterDto register { get; set; }
        /// <summary>
        /// 商品推荐设置
        /// </summary>
        public RecommendDto recommended { get; set; }
        /// <summary>
        /// 其他设置
        /// </summary>
        public OtherDto _other { get; set; }
    }

    /// <summary>
    /// 分类页模板设置
    /// </summary>
    public class PageCategoryTemplate
    {
        /// <summary>
        /// 分类页样式
        /// </summary>
        public int style { get; set; }
        /// <summary>
        /// 分享标题
        /// </summary>
        public string shareTitle { get; set; }
    }
    /// <summary>
    /// 积分设置
    /// </summary>
    public class PointsNameDto
    {
        /// <summary>
        /// 积分名称自定义
        /// </summary>
        public string points_name { get; set; }
        /// <summary>
        /// 积分说明
        /// </summary>
        public string describe { get; set; }
    }
    /// <summary>
    /// 充值设置
    /// </summary>
    public class RechargeDto
    {
        /// <summary>
        /// 是否允许用户充值
        /// </summary>
        public int is_entrance { get; set; } = 1;
        /// <summary>
        /// 是否允许自定义金额
        /// </summary>
        public int is_custom { get; set; } = 1;
        /// <summary>
        /// 充值说明
        /// </summary>
        public string describe { get; set; }
    }
    /// <summary>
    /// 账户注册设置
    /// </summary>
    public class RegisterDto
    {
        /// <summary>
        /// 默认注册方式: 10=>手机号+短信验证码
        /// </summary>
        public int registerMethod { get; set; } = 10;
        /// <summary>
        /// 个人中心页显示手动绑定手机号
        /// </summary>
        public int isManualBind { get; set; } = 1;
        /// <summary>
        /// 是否开启微信小程序一键授权登录
        /// </summary>
        public int isOauthMpweixin { get; set; }
        /// <summary>
        /// 是否开启微信公众号一键授权登录
        /// </summary>
        public int isOauthWxofficial { get; set; } = 1;

    }
    /// <summary>
    /// 商品推荐设置
    /// </summary>
    public class RecommendDto
    {
        /// <summary>
        /// 是否显示商品推荐
        /// </summary>
        public int enabled { get; set; } = 1;   
        /// <summary>
        /// 样式设置
        /// </summary>
        public RecommendStyle style { get; set; }
    }
    public class RecommendStyle
    {
        /// <summary>
        /// 组件标题,例如：商品推荐	
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 显示类型 (list列表平铺)
        /// </summary>
        public string display { get; set; } = "list";
        public int column { get; set; } = 2;
        public List<object> show { get; set; }
    }

    /// <summary>
    /// 其他设置
    /// </summary>
    public class OtherDto
    {
        /// <summary>
        /// 分销中心是否开启
        /// </summary>
        public bool isEnabledDealer { get; set; } = false;
        /// <summary>
        /// H5端访问地址
        /// </summary>
        public string h5Url { get; set; }
    }
}
